﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CMN.Entity
{
      ///<summary>
    ///Normal_TemplatesEntity实体类(模板方案)
    ///</summary>
    [Serializable]
    public partial class Normal_TemplatesEntity
    {
        #region "Private Variables"
        private DataTableAction _DataTable_Action;  // 操作方法 Insert:增加 Update:修改 Delete:删除
        private Int32 _Id=0; // 模板方案ID
        private String _Title=""; // 模板方案名称
        private String _Info=""; // 模板方案简介
        private String _Dir=""; // 模板路径
        private bool _IsDefault=false; // 是否默认
        private Int32 _SkinID=0; // 模板皮肤ID
        private string _DirName = "";
        private List<Normal_SkinEntity> _Skins = new List<Normal_SkinEntity>();
        #endregion

        #region "Public Variables"
        ///<summary>
        /// 操作方法 Insert:增加 Update:修改 Delete:删除
        ///</summary>
        public DataTableAction DataTable_Action
        {
            set { this._DataTable_Action = value; }
            get { return this._DataTable_Action; }
        }

        /// <summary>
        /// 模板皮肤列表
        /// </summary>
        public List<Normal_SkinEntity> Skins
        {
            get {return  this._Skins; }
            set { this._Skins = value; }
        }

        public string DirName
        {
            get
            {
                if ( _DirName == "")
                {
                    _DirName = Dir.Substring(Dir.IndexOf('\\'), (Dir.Length - Dir.IndexOf('\\')));

                }
                return _DirName;
            }
        }

        /// <summary>
        /// 添加皮肤
        /// </summary>
        /// <param name="skin"></param>
        public void AddSkin(Normal_SkinEntity skin)
        {
            _Skins.Add(skin);
        }
        /// <summary>
        /// 模板方案ID
        /// </summary>
        public Int32  Id
        {
            set { this._Id = value; }
            get { return this._Id; }
        }
        /// <summary>
        /// 模板方案名称
        /// </summary>
        public String  Title
        {
            set { this._Title = value; }
            get { return this._Title; }
        }
        /// <summary>
        /// 模板方案简介
        /// </summary>
        public String  Info
        {
            set { this._Info = value; }
            get { return this._Info; }
        }
        /// <summary>
        /// 模板路径
        /// </summary>
        public String  Dir
        {
            set { this._Dir = value; }
            get { return this._Dir; }
        }
        /// <summary>
        /// 是否默认
        /// </summary>
        public bool  IsDefault
        {
            set { this._IsDefault = value; }
            get { return this._IsDefault; }
        }
        /// <summary>
        /// 模板皮肤ID
        /// </summary>
        public Int32  SkinID
        {
            set { this._SkinID = value; }
            get { return this._SkinID; }
        }

        public string TemplateName { get; set; }
        #endregion
    }
}
